package statistics;

import evolutionaryProblems.Phenotype;

public class PopulationStatistics {

	private int generation; 
	private Phenotype bestPhenotype; 
	private Phenotype worstPhenotype; 
	private double avgFitness;
	private double standardDiviation; 
	
	
	public PopulationStatistics(Phenotype bestFitness, Phenotype worstFitness, double avgFitness, double standardDiviation) {
		this.bestPhenotype = bestFitness;
		this.worstPhenotype = worstFitness;
		this.avgFitness = avgFitness;
		this.setStandardDiviation(standardDiviation); 
	}
	
	
	public double getBestFitness() {
		if (bestPhenotype == null) {
			return 0; 
		}
		return bestPhenotype.getFitness();
	}
	
	public Phenotype getBest(){
		return bestPhenotype; 
	}
	
	public void setBest(Phenotype bestFitness) {
		this.bestPhenotype = bestFitness;
	}
	
	public double getWorstFitness() {
		if(worstPhenotype == null){
			return 0; 
		}
		return worstPhenotype.getFitness();
	}
	
	public Phenotype getWorst(){
		return worstPhenotype; 
	}
	
	public void setWorst(Phenotype worstFitness) {
		this.worstPhenotype = worstFitness;
	}
	
	public double getAvgFitness() {
		return avgFitness;
	}

	public void setAvgFitness(double avgFitness) {
		this.avgFitness = avgFitness;
	} 
	
	public int getGeneration() {
		return generation;
	}
	
	public void setGeneration(int generation) {
		this.generation = generation;
	}


	public double getStandardDiviation() {
		return standardDiviation;
	}


	public void setStandardDiviation(double standardDiviation) {
		this.standardDiviation = standardDiviation;
	}
	
}
